package imaa.escola.professor.repository;

import imaa.escola.professor.domain.Professor;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface ProfessorRepository extends JpaRepository<Professor, Long> {
	
	@Query("SELECT a FROM Professor a WHERE LOWER(a.nome) LIKE CONCAT('%', LOWER(:nome), '%')")
    public List<Professor> findByName(@Param("nome") String nome);
	

}
